<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>货拉拉物流有限公司</title>
		<meta name="keywords" content="拉拉货物流有限公司,汕头物流配送,汕头物流,汕头物流货运,汕头货运,全国货运,厦门物流配送,深圳物流配送,广州物流配送,物流配送,物流货运,货运配送" />
	    <meta name="description" content="拉拉货物流有限公司是一家承接全国各地门到门配送业务的专业第三方物流，为企业量身定做仓储、配送物流方案，针对大小客户配备专业项目小组进行专人专车对接。" />
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	    <link rel="stylesheet" href="css/amazeui.min.css" type="text/css" />
	    <link rel="stylesheet" href="css/style.css" type="text/css" />
		<link rel="stylesheet" type="text/css" href="layui/css/layui.css"/>
	    <script type="text/javascript" src="js/jquery.min.js" ></script>
	    <script type="text/javascript" src="js/amazeui.min.js" ></script>
		<script src="layui/layui.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body class="bgcolor">
	    <header data-am-widget="header" class="am-header am-header-default header-white">
	      <div class="am-header-left am-header-nav">
		     <a href="javascript:history.back()" class=""><i class="am-icon-chevron-left"></i></a>
	      </div>
	      <h1 class="am-header-title">找回密码</h1>
	      <div class="am-header-right am-header-nav">
	      	<a href="tel:10086">帮助</a>
	      </div>
        </header>
        <div class="jl"></div>
		<form >
        <input type="text" name="mail" id="email" placeholder="请输入邮箱（注册时填写）" class="login-name mt20">
        <div class="yzm mt20">
	    	<input type="text" class="reg-yzm" placeholder="输入验证码" name="mailcode" id="mailcode">
	    	<input type="button" class="yzm-hq" value="发送邮件">
	    </div>
	    <input type="text" id="pps" name="newPassword" placeholder="请输入新密码" class="login-name mt20">
	    <input type="text" id="confirm" placeholder="再次确认密码" class="login-name mt20">
	    <input type="button" class="login-btn" value="确定">
		</form>
	</body>
	<script type="text/javascript">
		layui.use(['layer','jquery'],function(){
			var url="http://localhost:8081"
			var layer=layui.layer;
			var $=layui.jquery;
			//发送邮件验证码
			$(".yzm-hq").click(function(){
				var code = $(".yzm-hq");
				code.attr("disabled","disabled");
				setTimeout(function(){
									   code.css("opacity","0.8");
				},1000)
				var time = 60;
				var set=setInterval(function(){
									   code.val("("+--time+")秒后重新获取");
				}, 1000);
				setTimeout(function(){
									   code.attr("disabled",false).val("重新获取验证码");
									   clearInterval(set);
				}, 60000);
				
				
				$.ajax({
					url:url+"/email?emailAddress="+$("#email").val(),
					type:'get',
					dataType:'json'
				})	
					
					
				
			})
			//找回密码
			$(".login-btn").click(function(){
				if($("#confirm").val()!=$("#pps").val()){
					layer.msg("请保持密码一致",{icon:5})
					return false;
				}
			$.ajax({
				url:url+"/user/pwdfind",
				type:'post',
				dataType:'json',
				data:$("form").serialize(),
				success:function(r){
					if(r.code!=200){
						layer.msg(r.message,{icon:5})
					}else{
						layer.msg("修改成功",{icon:1,time:3000})
						location.href='login.html'
					}
					
					
				}
			})	
				
				
			})
			
			
		})
		
	</script>
</html>
